<template>
	<view :class="uiStyle == 1 ? '' : 'uiStyle'">
		<!-- index.wxml -->
<!-- 		<view class="head-block" v-if="weixin == 2">
			<view class="nav-title" :style="'top:10px'"></view>
			<view class="icon" @tap="goMy" :style="'top:6px'">
				<van-icon name="arrow-left" color="#333" size="45rpx" />
			</view>
		</view> -->
		<van-toast id="van-toast" />
		<view class="top-box">
			<view class="contain-box" :style="weixin == 2 ? 'top:15px' : 'top:15px'">
				<!-- <view class="logo">
      <image src="/assets/img/fixedLogo.png"></image>
    </view> -->
				<view class="search-div" :style="weixin == 2 ? 'margin-left:45rpx' : ''">
					
						<view class="logo" v-if="weixin == 2" @tap="refreshSearch"><van-icon name="arrow-left" size="22" /></view>
						<!-- 采用此写法是为了兼容大屏端 -->
						<view class="search-div-cont" >
							<image src="../../static/assets/img/sous.png" mode="widthFix"></image>
							<view @tap="focusInput" class="search-div-cont-text">搜索目的地/车场名称</view>
						</view>
					
					
					
				</view>
				<view class="listSelect" @tap="goList()">
					<image class="listImg" src="../../static/assets/img/list.png"></image>
					<view>切换列表模式</view>
				</view>
			</view>
		</view>
		<view class="map" v-if="!allParkFlag || showPop">
			<map id="mymap" class="mapcontainer"
				:style="'height:' + (showPop ? screenHeightRPX - 500 : mapHeight) + 'rpx'" :longitude="center[0]"
				:latitude="center[1]" :markers="markers" @markertap="markerTap" scale="15" @labeltap="markerTap">
				<!-- <cover-view slot="callout">
					<block v-for="(item,index) in markers" :key="index">
						<cover-view class="customCallout" :marker-id="item.id">
							<cover-view class="content">
								{{item.realFreeNum}}
							</cover-view>
						</cover-view>
					</block>
				</cover-view>	 -->
					
			</map>
			
			<!-- <view class="map-shadow"></view> -->
			<!-- <view class="top-left-tip">
    <view class="weather" wx:if="{{weather.weather}}">{{weather.weather || '获取中'}} {{weather.temperature || ''}}℃</view>
    <view class="city-local" wx:if="{{weather.city}}">
      <image src="/assets/img/dingwei.png"></image>{{weather.city||'定位中'}}
    </view>
    <view class="control-box" wx:if="{{controlNo}}">今日限行 {{controlNo}}</view>
    <view class="control-box" wx:else>今日不限行</view>
  </view> -->
			<view class="viewlistd" @tap="moveTolocation" :style="'top:' + (showPop ? '750' : '520') + 'rpx'">
				<view class="viewlistblock" style="background: none">
					<view class="viewlittle" style="padding: 0">
						<image src="../../static/assets/img/location.png" mode="widthFix" class="" id=""
							style="width: 70rpx; height: 70rpx"></image>
					</view>
				</view>
			</view>
		</view>
		
		
		<!-- 颜色说明 -->
		<view v-if="!showPop" class="type_explain">
			<view class="type_zf">
				<image src="../../static/assets/img/type_2.png"></image>
				<text>机关企事业单位停车场</text>
			</view>
			<view class="type_sy">
				<image src="../../static/assets/img/type_1.png"></image>
				<text>小区、商业停车场</text>
			</view>
		</view>
		
		
		<!-- 地图弹窗 -->
		<view v-if="showPop" class="popbtm">
			<view class="close-img" @tap="closePop">
				<image style="width: 50rpx; height: 50rpx" src="/static/pages/index/imgs/close.png" mode="widthFix"></image>
			</view>
			<view class="closePosition" v-for="(item, index) in popData" :key="index">
				<image style="width: 30rpx; height: 40rpx; position: absolute; top: -25rpx; left: 30rpx"
					src="/static/pages/index/imgs/position.png" mode="widthFix"></image>

				<view class="navigatetext">{{ filters.toFix1(item.distance / 1000) }}km</view>
			</view>
			<view v-for="(item, index) in popData" :key="item.unitCode">
				<view class="flex-content">
					<view class="parkname">{{ item.parkingName }}</view>

					<!-- <view  class="parkrecommend {{item.isFocus==1?'like1':'nolike1'}} " wx:if='{{isLogin}}' data-item="{{item}}" data-index="{{index}}"
        data-isFocus="{{item.isFocus}}" data-id="{{item.parkingCode}}" catchtap="likeThisPark">{{item.isFocus==1?'已关注':'+关注'}}</view> -->
					<view :class="'parkrecommend ' + (item.isFocus == 1 ? 'like1' : 'nolike1') + ' '" v-if="isLogin"
						:data-item="item" :data-index="index" :data-isFocus="item.isFocus" :data-id="item.parkingCode"
						@tap.stop.prevent="likeThisPark">
						{{ item.isFocus == 1 ? '已关注' : '+关注' }}
					</view>
					<view v-if="isLogin" class="" :data-item="item" :data-index="index" :data-isFocus="item.isFocus"
						:data-id="item.parkingCode" style="padding: 5rpx">
						<!-- <image src="../../static/assets/img/carded.png" mode="widthFix"
							style="width: 30rpx; position: relative; left: 8rpx"></image> -->
					</view>
					<view class="parkrecommend" v-if="
                            !(filters.indexOf(item.supportBusiness, 1) ||
                            filters.indexOf(item.supportBusiness, 2) ||
                            filters.indexOf(item.supportBusiness, 3) ||
                            filters.indexOf(item.parkingAttribute, 1)
                                ? false
                                : true)
                        ">
						可预约
					</view>
				</view>

				<view class="flex-content flex-content2" style="padding-bottom: 25rpx">
					<view class="pop-address">{{ item.address || '暂无地址' }}</view>
				</view>

				<view class="flex-content" style="margin-top: 30rpx">
					<view class="restView">
						<view class="rest-num restNum1">{{ item.realFreeNum || '0' }}<text v-if="item.totalNum!=null">/</text>{{item.totalNum}}</view>
						<view class="rest-num restNum2">共享车位</view>
					</view>
					<view class="parkopen parkopen2">
						<!-- {{ item.openProperty == 1 ? '对公众开放' : '限小区居民' }} -->
						<view>开放时间段:</view>
						<view class="businessHours">{{item.businessHours}}</view>
						<view class="statu" style="display: flex; width: 265rpx; margin-top: 10rpx">
							<view class="statuView" v-if="item.haveCharge">
								<image mode="widthFix" class="img-tag" src="../../static/assets/img/elc.png" />
								<view>有充电桩</view>
							</view>
							<view class="statuView" v-if="item.buildType == 2">
								<image mode="widthFix" class="img-tag" src="../../static/assets/img/under.png" />
								<view>地下</view>
							</view>
							<view class="statuView" v-if="item.buildType == 1">
								<image mode="widthFix" class="img-tag" src="../../static/assets/img/ground.png" />
								<view>地面</view>
							</view>
							<view class="statuView" v-if="item.buildType == 3">
								<image mode="widthFix" class="img-tag" src="../../static/assets/img/3dpark.png" />
								<view>立体车库</view>
							</view>
						</view>
					</view>
				</view>

				<!-- <view class="flex-content" wx:if="{{item.contactPhone}}">
      <image src="./imgs/telphone2.png" class="tagimg"></image>
      <view class="pop-address">{{item.contactPhone || "暂无联系方式"}}</view>
    </view> -->

				<view class="flex-content" style="margin-top: 0rpx; margin-bottom: 0rpx">
					<view v-if="filters.indexOf(item.supportBusiness, 1)">
						<!-- <view wx:if="{{item.openTime}}" class="price-content price-content2">
          服务时间：{{item.openTime}}
       </view> -->
						<view class="menu-box" v-if="item.parkingAttribute == 1">
							<view style="display: flex;flex-wrap: wrap;">
								<view class="menu-box-item">小区业主自主定价</view>
							</view>
						</view>
						<!-- <view class="menu-box" v-if="item.productVOs != null && item.parkingAttribute != 1">
							<view style="display: flex;flex-wrap: wrap;">
								<view class="menu-box-item" v-if="pvos.type == 3"
									v-for="(pvos, index1) in item.productVOs" :key="index1">
									临停：

									<text class="menu-box-item-unit" v-if="pvos.unitPrice / 100==0">免费</text>
									<text class="menu-box-item-unit" v-else>￥{{ pvos.unitPrice / 100 }}元/小时</text>

								</view>
								<view class="menu-box-item" v-if="pvos.type == 1"
									v-for="(pvos, index1) in item.productVOs" :key="index1">
									包月：

									<text class="menu-box-item-unit">￥{{ pvos.unitPrice / 100 }}</text>

									元/月
								</view>
								<view class="menu-box-item" v-if="pvos.type == 2"
									v-for="(pvos, index1) in item.productVOs" :key="index1">
									夜间包月：

									<text class="menu-box-item-unit">￥{{ pvos.unitPrice / 100 }}</text>

									元/月
								</view>
							</view>
						</view> -->
					</view>
					<view v-else>
						<!-- <view wx:if="{{item.openTime}}" class="price-content price-content2">
          服务时间：{{item.openTime}}
       </view> -->
						<view class="menu-box" v-if="item.parkingAttribute == 1">
							<view style="display: flex;flex-wrap: wrap;">
								<view class="menu-box-item">小区业主自主定价</view>
							</view>
						</view>
						<!-- <view class="menu-box" v-if="item.productVOs != null && item.parkingAttribute != 1">
							<view style="display: flex;flex-wrap: wrap;">
								<view class="menu-box-item" v-if="pvos.type == 3"
									v-for="(pvos, index1) in item.productVOs" :key="index1">
									临停：

									<text class="menu-box-item-unit" v-if="pvos.unitPrice / 100==0">免费</text>
									<text class="menu-box-item-unit" v-else>￥{{ pvos.unitPrice / 100 }}元/小时</text>

								</view>
								<view class="menu-box-item" v-if="pvos.type == 1"
									v-for="(pvos, index1) in item.productVOs" :key="index1">
									包月：

									<text class="menu-box-item-unit">￥{{ pvos.unitPrice / 100 }}</text>

									元/月
								</view>
								<view class="menu-box-item" v-if="pvos.type == 2"
									v-for="(pvos, index1) in item.productVOs" :key="index1">
									夜间包月：

									<text class="menu-box-item-unit">￥{{ pvos.unitPrice / 100 }}</text>

									元/月
								</view>
							</view>
						</view> -->
					</view>
				</view>

				<view class="card" style="display: flex; position: relative; top: 15rpx">
					<view class="ltView" :style="'display:' + (filters.indexOf(item.supportBusiness, 1) ? 'block' : 'none') + ' ; width: 210rpx;height: 96rpx;margin-right: 20rpx;'"
						v-if="item.lltParkingInfoType != 2">
						<view v-if="filters.indexOf(item.supportBusiness, 1)">
							<image class="baoyueimg" src="../../static/assets/img/card-lv-hover1.png"
								@tap.stop.prevent="tempParking" :data-data="item" style="width: 210rpx" mode="widthFix">
								<view class="yylt" @tap.stop.prevent="tempParking" :data-data="item">预约临停</view>
								<view class="yyjg" v-if="pvos.type == 3 && item.productVOs != null && item.parkingAttribute != 1"
									v-for="(pvos, index1) in item.productVOs" :key="index1">
									<text class="yyjg_mf" v-if="pvos.unitPrice / 100==0">免费</text>
									<text class="yyjg_xs" v-else><text>{{ pvos.unitPrice / 100 }}</text>元/小时</text>
								
								</view>
							</image>
						</view>

						<view v-else>
							<!-- <view class="leftcard" catchtap="noResponse">
          </view> -->
						</view>
					</view>
					<view class="byView" style="width: 210rpx; height: 96rpx;margin-right: 20rpx;"
						v-if="filters.indexOf(item.supportBusiness, 2)">
						<image class="baoyueimg" src="../../static/assets/img/card-lv-hover2.png"
							@tap.stop.prevent="monthlyParking" :data-data="item" data-type='1' style="width: 210rpx" mode="widthFix">
							<view class="yyby" @tap.stop.prevent="monthlyParking" :data-data="item" data-type='1'>预约包月</view>
							<view class="yyjg" v-if="pvos.type == 1 && item.productVOs != null && item.parkingAttribute != 1" 
								v-for="(pvos, index1) in item.productVOs" :key="index1">
								
								<text class="yyjg_xs"><text>{{ pvos.unitPrice / 100 }}</text>元/月</text>
							
								
							</view>
						</image>
					</view>
					
					<view class="byView" style="width: 210rpx; height: 96rpx"
						v-if="filters.indexOf(item.supportBusiness, 3) ">
						<image class="baoyueimg" src="../../static/assets/img/card-lv-hover3.png"
							@tap.stop.prevent="monthlyParking" :data-data="item" data-type='2' style="width: 210rpx" mode="widthFix">
							<view class="yyby" @tap.stop.prevent="monthlyParking" :data-data="item" data-type='2'>夜间包月</view>
							<view class="yyjg" v-if="pvos.type == 2 && item.productVOs != null && item.parkingAttribute != 1"
								v-for="(pvos, index1) in item.productVOs" :key="index1">
							
								<text class="yyjg_xs"><text>{{ pvos.unitPrice / 100 }}</text>元/月</text>
							
								
							</view>
						</image>
					</view>
				</view>

				<view class="pop-rt-content" style="top: 165rpx; right: -22rpx">
					<!-- <view class="rest-num">{{item.realFreeNum || '0'}}</view>
      <view class="rest-text">实时余位</view> -->
					<view :data-data="item" style="display: flex; position: relative; top: 50rpx">
						<view class="byView" v-if="item.guidePicture" @tap.stop.prevent="toNavigateYd"
							:data-name="item.parkingName" :data-guidepicture="item.guidePicture"
							:data-id="item.parkingCode">
							<!-- wx:if="{{item.guidePicture}}" -->
							<image class="baoyueimg" style="top: -32rpx; left: 8rpx; display: block; width: 60rpx"
								mode="widthFix" :data-id="item.parkingCode" src="../../static/assets/img/tcyd.png">
							</image>
							<view class="tcyd" style="width: 150rpx; height: 90rpx; line-height: 90rpx">停车引导</view>
						</view>
						<view class="byView" @tap.stop.prevent="toNavigate" :data-data="item">
							<image class="baoyueimg" style="top: -32rpx; left: 8rpx; display: block; width: 60rpx"
								mode="widthFix" src="../../static/assets/img/ccdh.png"></image>
							<view class="ccdh" style="width: 150rpx; height: 90rpx; line-height: 90rpx">车场导航</view>
						</view>
					</view>
				</view>

				<view class="middleline" v-if="index != popData.length - 1"></view>
			</view>
		</view>

		<!-- 我的关注 -->
		<!-- <view class="btm"  hidden="{{showPop}}" >
  <view class="search-contain">
  <view class="recommend-content recommend-contentLike">
  <image src="/assets/img/cardList.png" class="cardList"></image>
  <view class="careWord">我的关注</view>
  </view>
  </view>
  <view wx:if="{{showSearch}}" class="search-area">
    <view  style="height: {{scrollHeight}}rpx;" wx:if="{{addressList.length > 0}}">
      <view wx:for="{{addressList}}" wx:key="index">
        <view class="search-list">
          <view bindtap="selectAddr" data-data="{{item}}">
            <view class="address-name">
              <image src="./imgs/distance2.png"></image>
              {{item.title}}
            </view>
            <view class="addr-content">地址：{{item.address}}</view>
          </view>
          <view style="float:right" catchtap="gotoNavigate" data-data="{{item}}">
            <image src="/assets/img/navigation2.png" class="navigateimg route-img"></image>
            <view class="navigatetext">路线</view>
          </view>
        </view>
        <view class="middleline"></view>
      </view>
    </view>
    <view style="height: {{scrollHeight}}rpx;text-align:center;padding-top:50rpx" wx:if="{{addressList.length == 0}}">
      搜索无结果
    </view>
  </view>
  <view class="park-cardLike"  wx:else>
    <view style="height: {{isScroll? scrollHeight : ''}}rpx;"  wx:if="{{parkListLike.length>0}}">
      <view wx:for="{{parkListLike}}" class="park-contain" wx:key="unitCode" catchtap="markerTap" data-parkingCode="{{item.parkingCode}}">
        <view class="park-content"  data-data="{{item}}">
          <view>
              <view style="display:flex;align-items:center">
                <view class="parkname">{{item.parkingName}}</view>
                <view class="parkrecommend" hidden="{{item.recommend == 1 ? false : true}}">荐</view>
              </view>
          </view>
          <view class="card">
            <view wx:if="{{filters.indexOf(item.supportBusiness,1)}}">
              <view class="leftcard {{item.openProperty == 1 ? '' : item.isAuth == 2 ? 'bg-EE' : ''}}" catchtap="tempParking" data-data="{{item}}">
                <view class="price-content">
                  <view class="price">￥{{(item.tempReserveProduct.unitPrice)/100 || '--'}}</view>
                  <view class="unit">元/小时</view>
                </view>
                <view class="fee-content">· {{filters.split(item.tempReserveProduct.productDesc)[0]}}</view>
                <view class="fee-content">· {{filters.split(item.tempReserveProduct.productDesc)[1]}}</view>
              </view>
              <view class="tagtitle {{item.openProperty == 1 ? 'bg2' : item.isAuth == 2 ? 'bg-D1' : 'bg2'}}">
                预约临停
              </view>
            </view>
            <view wx:else>
              <view class="leftcard" catchtap="noResponse">
                <view class="price-content gotop">
                  <view class="price">￥{{(item.tempProduct.unitPrice)/100}}</view>
                  <view class="unit">元/小时</view>
                </view>
                <view class="fee-content">
                  · {{filters.split(item.tempProduct.productDesc)[0]}}
                </view>
                <view class="fee-content">
                  · {{filters.split(item.tempProduct.productDesc)[1]}}
                </view>
              </view>
            </view>
            <view wx:if="{{filters.indexOf(item.supportBusiness,2) || filters.indexOf(item.supportBusiness,3)}}">
              <view class="leftcard baoyue-card {{item.openProperty == 1 ? '' : item.isAuth == 2 ? 'bg-EE' : ''}}" catchtap="monthlyParking" data-data="{{item}}">
                限量折扣月卡
              </view>
              <view class="tagtitle {{item.openProperty == 1 ? 'bg3' : item.isAuth == 2 ? 'bg-D1' : 'bg3'}}">
                预约包月
              </view>
            </view>
          </view>
        </view>
        <view class="rt-content">
                <view class="rest-num">{{item.realFreeNum || '0'}}</view>
                <view class="rest-text">实时余位</view>
                <view catchtap="toNavigate" data-data="{{item}}">
                <image src="/assets/img/navigation2.png" class="navigateimg"></image>
                <view class="navigatetext">距离{{filters.toFix1(item.distance/1000)}}km</view>
              </view>
        </view>
      </view>
    </view>
    <view class="careInfoView"  style="height: {{isScroll? scrollHeight : ''}}rpx;" wx:else>
    <view class="careInfo">关注车场，可获取车场相关信息></view>
    </view>
  </view>
</view> -->

		<!-- 车位列表 -->
		<view class="btm" v-if="!showPop">
			<view class="line"></view>
			<view class="search-contain">
				<view class="recommend-content">
					<view>
						<text
							style="font-family: SourceHanSansCN-Medium; font-size: 26rpx; color: #616161; letter-spacing: 0; font-weight: 500">为您推荐附近停车场</text>
						<view style="
                                display: inline-block;
                                margin-left: 35rpx;
                                font-family: SourceHanSansCN-Regular;
                                font-size: 20rpx;
                                color: #999999;
                                letter-spacing: 0;
                                font-weight: 400;
                            ">
							<image src="../../static/assets/img/dingwei2.png" style="width: 16rpx" mode="widthFix">
							</image>
							当前定位:{{ searchName ? searchName : '当前位置' }}
						</view>
					</view>

					<!-- <view class="goAllParking" bindtap="goAllParking">
        查看全部车场  <image class="rightIcon" mode="widthFix" src="./imgs/arrow_r.png"></image>
      </view> -->
				</view>
			</view>
			<!-- 搜索地址列表 -->
			<view v-if="showSearch" class="search-area">
				<view :style="'height: ' + scrollHeight + 'rpx;'" v-if="addressList.length > 0">
					<view v-for="(item, index) in addressList" :key="index">
						<view class="search-list">
							<view @tap="selectAddr" :data-data="item">
								<view class="address-name">
									<image src="/static/pages/index/imgs/distance2.png"></image>
									{{ item.title }}
								</view>
								<view class="addr-content">地址：{{ item.address }}</view>
							</view>
							<view style="float: right" @tap.stop.prevent="gotoNavigate" :data-data="item">
								<image src="../../static/assets/img/navigation2.png" class="navigateimg route-img">
								</image>
								<view class="navigatetext">路线</view>
							</view>
						</view>

						<view class="middleline"></view>
					</view>
				</view>
				<view :style="'height: ' + scrollHeight + 'rpx;text-align:center;padding-top:50rpx'"
					v-if="addressList.length == 0">搜索无结果</view>
			</view>
			<!-- 卡片部分 -->
			<view class="park-card" v-else>
				<view :style="'height: ' + (isScroll ? scrollHeight : '') + 'rpx;'" v-if="parkList.length > 0">
					<view class="park-contain" :class="item.parkingAttribute == 1 && item.openProperty == 2 && item.isAuth != 1 ? 'park_bg' : ''"  @tap.stop.prevent="markerTap" :data-parkingAttribute="item.parkingAttribute" :data-openProperty="item.openProperty"   :data-parkingCode="item.parkingCode"
						v-for="(item, index) in parkList" :key="item.unitCode" :data-isAuth="item.isAuth">
						<view class="park-content" :data-data="item">
							<view>
								<view style="display: flex; align-items: center">
									<!-- <image src="./imgs/distance2.png" class="tagimg"></image> -->
									<image src="../../static/assets/img/pos.png" class="tagimg"></image>
									<view class="parkname">{{ item.parkingName }}</view>
									<!-- <view class="parkopen">{{item.openProperty == 1 ?'对公众开放':'限小区居民'}}</view> -->

									<view v-if="isLogin && item.isFocus == 1">
										<image src="../../static/assets/img/follow.png" class="follow-img"></image>
									</view>
									<view class="parkrecommend" v-if="
                                            !(filters.indexOf(item.supportBusiness, 1) ||
                                            filters.indexOf(item.supportBusiness, 2) ||
                                            filters.indexOf(item.supportBusiness, 3) ||
                                            filters.indexOf(item.parkingAttribute, 1)
                                                ? false
                                                : true)
                                        ">
										可预约
									</view>
									<!-- <image wx:if='{{isLogin}}' data-item="{{item}}" data-index="{{index}}"
                src="{{item.isFocus==1?'/assets/img/nocared.png':'/assets/img/cared.png'}}" class="likeImg"
                data-isFocus="{{item.isFocus}}" data-id="{{item.parkingCode}}" catchtap="likeThisPark"></image> -->
								</view>
							</view>
							<view class="card">
								<view class="flex-content">
									<view class="pop-address">{{ item.address || '暂无地址' }}</view>
								</view>
								<view class="flex-content rest-contain">
									<view class="rest-text">共享车位</view>
									<view class="rest-num">{{ item.realFreeNum || '0' }}<text v-if="item.totalNum!=null">/</text>{{item.totalNum}}</view>
								</view>
								<view class="statu" style="display: flex; display: inline-block">
									<view class="statuView" v-if="item.haveCharge">
										<image mode="widthFix" class="img-tag" src="../../static/assets/img/elc.png" />
										<view>有充电桩</view>
									</view>
									<view class="statuView" v-if="item.buildType == 2">
										<image mode="widthFix" class="img-tag"
											src="../../static/assets/img/under.png" />
										<view>地下</view>
									</view>
									<view class="statuView" v-if="item.buildType == 1">
										<image mode="widthFix" class="img-tag"
											src="../../static/assets/img/ground.png" />
										<view>地面</view>
									</view>
									<view class="statuView" v-if="item.buildType == 3">
										<image mode="widthFix" class="img-tag"
											src="../../static/assets/img/3dpark.png" />
										<view>立体车库</view>
									</view>
								</view>
							</view>
							<view class="menu-box" v-if="item.parkingAttribute == 1">
				<!-- 				<view style="display: flex;flex-wrap: wrap;">
									<view class="menu-box-item">小区业主自主定价</view>
								</view> -->
							</view>
							<view class="businesshours">开放时间段：{{item.businessHours}}</view>
							<!-- <view class="menu-box" v-if="item.productVOs != null && item.parkingAttribute != 1">
								<view style="display: flex;flex-wrap: wrap;">
									<view class="menu-box-item" v-if="pvos.type == 3"
										v-for="(pvos, index1) in item.productVOs" :key="index1">
										临停：
										<text class="menu-box-item-unit" v-if="pvos.unitPrice / 100==0">免费</text>
										<text class="menu-box-item-unit" v-else>￥{{ pvos.unitPrice / 100 }}元/小时</text>

										
									</view>
									<view class="menu-box-item" v-if="pvos.type == 1"
										v-for="(pvos, index1) in item.productVOs" :key="index1">
										包月：

										<text class="menu-box-item-unit">￥{{ pvos.unitPrice / 100 }}</text>

										元/月
									</view>
									<view class="menu-box-item" v-if="pvos.type == 2"
										v-for="(pvos, index1) in item.productVOs" :key="index1">
										夜间包月：

										<text class="menu-box-item-unit">￥{{ pvos.unitPrice / 100 }}</text>

										元/月
									</view>
								</view>
							</view> -->
						</view>

						<view class="rt-content">
							<view @tap.stop.prevent="toNavigate" :data-data="item">
								<image src="../../static/assets/img/navigation3.png" class="navigateimg"></image>
								<view class="navigatetext">距离{{ filters.toFix1(item.distance / 1000) }}km</view>
								<!-- <view class="navigatetext" data-id="{{item.parkingCode}}" catchtap="toNavigateYd">车位引导</view> -->
							</view>
						</view>
					</view>
				</view>
				<view :style="'height: ' + (isScroll ? scrollHeight : '') + 'rpx;'" v-else>
					<van-empty image="search" description="暂无数据" v-if="!isShowLoading" />
				</view>
			</view>
		</view>
		<!-- 全部车位列表 -->
		<view class="btm allPark" v-if="allParkFlag && !showPop">
			<view class="search-contain">
				<van-dropdown-menu>
					<van-dropdown-item @change="change1" v-model="topvalue1" :options="topoption1" />
					<van-dropdown-item @change="change2" v-model="topvalue2" :options="topoption2" />
					<van-dropdown-item @change="change3" v-model="topvalue3" :options="topoption3" />
				</van-dropdown-menu>
			</view>
			<!-- 搜索地址列表 -->
			<view v-if="showSearch" class="search-area">
				<view :style="'height: ' + scrollHeight + 'rpx;'" v-if="addressList.length > 0">
					<view v-for="(item, index) in addressList" :key="index">
						<view class="search-list">
							<view @tap="selectAddr" :data-data="item">
								<view class="address-name">
									<image src="/static/pages/index/imgs/distance2.png"></image>
									{{ item.title }}
								</view>
								<view class="addr-content">地址：{{ item.address }}</view>
							</view>
							<view style="float: right" @tap.stop.prevent="gotoNavigate" :data-data="item">
								<image src="../../static/assets/img/navigation2.png" class="navigateimg route-img">
								</image>
								<view class="navigatetext">路线</view>
							</view>
						</view>

						<view class="middleline"></view>
					</view>
				</view>
				<view :style="'height: ' + scrollHeight + 'rpx;text-align:center;padding-top:50rpx'"
					v-if="addressList.length == 0">搜索无结果</view>
			</view>
			<!-- 卡片部分 -->
			<view class="park-card2" v-else>
				<view :style="'height: ' + (isScroll ? scrollHeight : '') + 'rpx;'" v-if="parkList.length > 0">
					<view class="park-contain" :class="item.parkingAttribute == 1 && item.openProperty == 2 && item.isAuth != 1 ? 'park_bg' : ''"   @tap.stop.prevent="markerTap" :data-parkingAttribute="item.parkingAttribute" :data-openProperty="item.openProperty" :data-parkingCode="item.parkingCode"
						v-for="(item, index) in parkList" :key="item.unitCode">
						<view class="park-content" :data-data="item">
							<view>
								<view style="display: flex; align-items: center">
									<image src="/static/pages/index/imgs/distance2.png" class="tagimg"></image>
									<view class="parkname">{{ item.parkingName }}</view>
									<view class="parkrecommend" v-if="
                                            !(filters.indexOf(item.supportBusiness, 1) ||
                                            filters.indexOf(item.supportBusiness, 2) ||
                                            filters.indexOf(item.supportBusiness, 3) ||
                                            filters.indexOf(item.parkingAttribute, 1)
                                                ? false
                                                : true)
                                        ">
										可预约
									</view>
									<view class="parkrecommend2" v-if="
                                            !(filters.indexOf(item.supportBusiness, 1) || filters.indexOf(item.supportBusiness, 2) || filters.indexOf(item.supportBusiness, 3)
                                                ? false
                                                : true)
                                        ">
										已关注
									</view>
									<!-- <image wx:if='{{isLogin}}' data-item="{{item}}" data-index="{{index}}"
                src="{{item.isFocus==1?'/assets/img/nocared.png':'/assets/img/cared.png'}}" class="likeImg"
                data-isFocus="{{item.isFocus}}" data-id="{{item.parkingCode}}" catchtap="likeThisPark"></image> -->
								</view>
							</view>
							<view class="card">
								<view class="flex-content">
									<view class="pop-address">{{ item.address || '暂无地址' }}</view>
								</view>
								<view class="flex-content">
									<view class="rest-text">共享车位：{{ item.realFreeNum || '0' }}</view>
									<view class="rest-num"></view>
								</view>
								<view class="statu" style="display: flex; display: inline-block">
									<view class="statuView" v-if="item.haveCharge">
										<image mode="widthFix" class="img-tag" src="../../static/assets/img/elc.png" />
										<view>有充电桩</view>
									</view>
									<view class="statuView" v-if="item.buildType == 2">
										<image mode="widthFix" class="img-tag"
											src="../../static/assets/img/under.png" />
										<view>地下</view>
									</view>
									<view class="statuView" v-if="item.buildType == 1">
										<image mode="widthFix" class="img-tag"
											src="../../static/assets/img/ground.png" />
										<view>地面</view>
									</view>
									<view class="statuView" v-if="item.buildType == 3">
										<image mode="widthFix" class="img-tag"
											src="../../static/assets/img/3dpark.png" />
										<view>立体车库</view>
									</view>
								</view>
							</view>
						</view>

						<view class="rt-content">
							<view @tap.stop.prevent="toNavigate" :data-data="item">
								<image src="../../static/assets/img/navigation2.png" class="navigateimg"></image>
								<view class="navigatetext">距离{{ filters.toFix1(item.distance / 1000) }}km</view>
								<!-- <view class="navigatetext" data-id="{{item.parkingCode}}" catchtap="toNavigateYd">车位引导</view> -->
							</view>
						</view>
					</view>
				</view>
				<view :style="'height: ' + (isScroll ? scrollHeight : '') + 'rpx;'" v-else>
					<van-empty image="search" description="暂无数据" v-if="!isShowLoading" />
				</view>
			</view>
		</view>
		<van-dialog id="van-dialog" v-model="isShowPayTip" title="支付提醒" confirm-button-text="去支付"
			cancel-button-text="稍后再看" confirm-button-color="#00BCAB" cancel-button-color="#AEAEAE"
			v-model-cancel-button="true" message="您有订单未支付，请尽快支付" @confirm="gotoPay($event, { tagId: 'van-dialog' })" />
		<van-dialog id="van-dialog" v-model="isShowAddLicense" title="提示" confirm-button-text="去添加"
			cancel-button-text="稍后添加" confirm-button-color="#00BCAB" cancel-button-color="#AEAEAE"
			v-model-cancel-button="true" message="您还没有车牌" @confirm="gotoAddLicense($event, { tagId: 'van-dialog' })" />
	</view>
</template>
<script module="filters" lang="wxs" src="../../utils/filter.wxs"></script>
<script>
	// import vanRow from '@vant/weapp/row/index';
	// import vanCol from '@vant/weapp/col/index';
	// import vanDropdownMenu from '@vant/weapp/dropdown-menu/index';
	// import vanDropdownItem from '@vant/weapp/dropdown-item/index';
	// import vanToast from '@vant/weapp/toast/index';
	import user from '../user/index';
	// import vanEmpty from '@vant/weapp/empty/index';
	// index.js
	// 获取应用实例
	const app = getApp();
	import util from './../../utils/util.js';
	import api from './../../utils/api.js';
	// import Toast from '@vant/weapp/toast/toast';
	import amapFile from './../../utils/amap-wx.js'; // import config from '../../utils/config';
	import {
		Dialog
	} from 'vant';

	export default {
		components: {
			// vanRow,
			// vanCol,
			// vanDropdownMenu,
			// vanDropdownItem,
			// vanToast,
			// user,
			// vanEmpty 
		},
		data() {
			return {
				searchShow: false,
				topvalue1: '杭州',
				topvalue2: '0',
				topvalue3: '0',

				topoption1: [{
					text: '杭州',
					value: '杭州'
				}],

				topoption2: [{
						text: '全部',
						value: '0'
					},
					{
						text: '我的关注',
						value: '1'
					}
				],

				topoption3: [{
					text: '距离优先',
					value: '0'
				}],

				isLogin: 0,

				//0未登录 1已登录
				option1: [{
						text: '全部',
						value: 0
					},
					{
						text: '推荐',
						value: 1
					},
					{
						text: '临停预约',
						value: 2
					},
					{
						text: '包整月',
						value: 3
					},
					{
						text: '夜间包月',
						value: 4
					}
				],

				bannerUrls: [],
				imgheights: '',
				longitude: '',
				latitude: '',
				autoSearch: '',
				isSearch: 0,
				value1: 0,
				startY: 0,

				//滑动开始y轴位置
				lastY: 0,

				//滑动开始y轴位置
				parkList: [],

				parkListLike: [],
				markers: [],
				showPop: false,
				allParkFlag: false,
				center: [120.140812, 30.176627],
				timer: null,
				// marginTopmenuBtn: uni.getMenuButtonBoundingClientRect(),
				popData: [],
				showMonth: false,

				//是否支持包月
				showReserve: false,

				//是否支持预约
				hideReleasepop: true,

				btmTop: '890',
				showUser: false,
				isScroll: false,
				scrollHeight: '',
				showSearch: false,

				//是否展示搜索列表
				addressList: [],

				screenHeightRPX: '',

				//屏幕高度rpx
				mapHeight: '750',

				isAndroid: false,
				isShowPayTip: false,

				//是否提示未支付订单
				showDropdown: false,

				//是否下拉
				isSearching: false,

				//是否正在搜索--显示右侧搜索
				showBack: false,

				//输入框聚焦时的返回按钮
				gotopayType: '',

				weather: {},

				//天气信息
				pageNumber: 1,

				controlNo: '',
				isShowAddLicense: false,

				//当前为加载状态时不可展示‘无数据’
				isShowLoading: false,

				searchName: '',
				isFixSpaceNumer: '',

				pvos: {
					type: 0,
					unitPrice: 0
				},
				uiStyle: 1,
				weixin: uni.getStorageSync('weixin')
			};
		},
		onLoad(options) {
			if(options.parking){
				Dialog.confirm({
				  title: '提示',
				  message:'为了给业主提供更好的停车体验，“邻里停”将获取您的业主身份信息（小区名称、车位号)用于身份验证。',
				  confirmButtonText:'前往授权',
				  confirmButtonColor:'#00bcab'
				})
				  .then(() => {
					  jWeixin.miniProgram.navigateTo({
						  url:"/pages/login/login?parking=" + options.parking
						})
					// on confirm
				  })
				  .catch(() => {
					// on cancel
				  });
			}else{
				if (uni.getStorageSync('weixin') == 2 && options.code) {
					let {
						code,
						encryptedData,
						iv,
						nikeName
					} = options
					uni.showLoading({
						title: '加载中'
					});
					let param = {
						code
					};
					util.request(api.wxLogin, param, 'POST')
						.then((res) => {
							if (res.success) {
								//有openid直接进首页前也要判断有无车牌
								uni.hideLoading();
								uni.setStorage({
									key: 'AUTHORIZATION',
									data: res.data.busiInfo.token
								}); //token
								this.setStorages(res); //开始存储所需要的信息
								if (res.data.busiInfo.phoneNumber) {
									let phoneData = {
										phone:res.data.busiInfo.phoneNumber
									}
									util.request(api.newSeeCustSpaceInit, phoneData, 'GET')
										.then((result) => {
											if (result.success) {
												uni.hideLoading();
												
											} else {
												uni.hideLoading();
												uni.showToast({
													title: result.msg || '接口出错了，请重试',
													icon: 'none'
												});
												let that = this;
											}
										})
								}
							} else {
								//无openid去绑定,有车牌直接进首页，无则进修改页---没有车牌也暂时跳过去首页
								uni.setStorage({
									key: 'AUTHORIZATION',
									data: res.data.busiInfo.token
								});
								uni.setStorage({
									key: 'openId',
									data: res.data.busiInfo.openId
								}); //openId
				
								const wechatUnionId = res.wechatUnionId;
								let param = {
									nikeName: '用户_' + nikeName,
									openId: res.data.busiInfo.openId,
									url: '',
									encryptedData:encryptedData + "==",
									iv:iv + "==",
									wechatUnionId: wechatUnionId
								}; // 如果从分享进来注册的，还需要加上分享人的参数
								if (uni.getStorageSync('shareId')) {
									param.originUnionId = uni.getStorageSync('shareId') || '';
								}
				
								if (uni.getStorageSync('activityCode')) {
									param.activityCode = uni.getStorageSync('activityCode') || '';
								}
								util.request(api.wxBind, param, 'POST')
									.then((resp) => {
										if (resp.success) {
											uni.hideLoading();
											uni.removeStorageSync('shareId'); //移除掉分享者id缓存
				
											uni.setStorage({
												key: 'AUTHORIZATION',
												data: resp.data.busiInfo.token
											}); //token
				
											this.setStorages(resp);
											if (gotoLLT) {
												let phoneData = {
													phone:resp.data.busiInfo.phoneNumber
												}
												util.request(api.newSeeCustSpaceInit, phoneData, 'GET')
													.then((result) => {
														if (result.success) {
															uni.hideLoading();
															
														} else {
															uni.hideLoading();
															uni.showToast({
																title: result.msg || '接口出错了，请重试',
																icon: 'none'
															});
															let that = this;
														}
													})
											}
				
										} else {
											uni.hideLoading();
											uni.showToast({
												title: resp.msg || '接口出错了，请重试',
												icon: 'none'
											});
											let that = this;
										}
									})
							}
							this.onloads(options)
						})
						.catch((err) => {
							uni.hideLoading();
							let that = this;
							// uni.showToast({
							// 	title: '接口出错了，请重试',
							// 	icon: 'none'
							// });
						});
				}else{
					this.uiStyle = uni.getStorageSync('uiStyle') || 1
					let that = this;
					uni.getSystemInfo({
						success: (res) => {
							// console.log(res)
							this.setData({
								scrollHeight: res.screenHeight * (750 / res.windowWidth) - 350 - (res
									.platform == 'android' ? 70 : 120),
								//再减去50的底部tab
								screenHeightRPX: res.screenHeight * (750 / res.windowWidth),
								isAndroid: res.platform == 'android' ? true : false
							});
						}
					});
					uni.showLoading({
						title: '加载中'
					});
					this.setData({
						isShowLoading: true
					});
					
					if (!uni.getStorageSync('isSearching')) {
						that.getCurLocation();
					}
					
					if (uni.getStorageSync('AUTHORIZATION')) {
						this.setData({
							isLogin: 1
						});
						this.isWaitingtopay();
					}
					that.getTrafficControl();
					setTimeout(function() {
						that.getWeather();
					}, 31000); // 处理关于分享的用户unionId
					
					if (options.shareId && options.shareId != '') {
						uni.setStorageSync('shareId', options.shareId);
					}
					
					if (options.activityCode && options.activityCode != '') {
						uni.setStorageSync('activityCode', options.activityCode);
					}
				}
				
			}
			
		},
		onHide() {
			clearInterval(this.timer);
		},
		// 上拉刷新
		// onReachBottom(e){
		//   console.log(e)
		//   let num = this.data.pageNumber + 1
		//   this.setData({
		//     pageNumber :num
		//   },
		//   ()=>this.getParklist())
		// },
		// onShareAppMessage: function () {
		// }
		onShow() {
			this.setData({
				searchShow: false
			}); // tabbar不支持url后带参数 ，只能存一下

			if (uni.getStorageSync('isSearching')) {
				this.selectAddr(uni.getStorageSync('searchHistory')[0]);
				this.setData({
					searchShow: true,
					searchName: uni.getStorageSync('searchHistory')[0].name
				});
			} else {
				this.clearInput();
				this.getCurLocation();
				this.setData({
					center: [this.longitude, this.latitude]
				});
			}

			this.setData({
				showPop: false,
				allParkFlag: false
			}); // 存储当前页面-登陆后跳转至登录前页面

			const page = getCurrentPages(); // console.log(page[0].route)

			uni.setStorageSync('lastPagePath', '/' + page[0].route);

			if (uni.getStorageSync('AUTHORIZATION')) {
				this.setData({
					isLogin: 1
				}); // this.getParklistLike()
			}
		},

		/**
		 * 用户点击右上角分享
		 */
		methods: {
/***缓存参数 */
			setStorages(res) {
				uni.setStorage({
					key: 'name',
					data: res.data.busiInfo.name
				}); //姓名

				uni.setStorage({
					key: 'phoneNumber',
					data: res.data.busiInfo.phoneNumber
				}); //手机号

				uni.setStorage({
					key: 'faceImageUrl',
					data: res.data.busiInfo.faceImageUrl
				}); //头像

				uni.setStorage({
					key: 'identityId',
					data: res.data.busiInfo.identityId
				}); //用户id

				uni.setStorage({
					key: 'unionId',
					data: res.data.busiInfo.unionId
				}); //用户id

				if (res.data.busiInfo.plateNos != null && res.data.busiInfo.plateNos.length > 0) {
					uni.setStorage({
						key: 'status',
						data: true
					}); //状态

					uni.setStorage({
						key: 'plateNos',
						data: res.data.busiInfo.plateNos.map((e) => e).toString()
					}); //用户车牌号
					// v2.5.4新加的访客链接进入时的逻辑

					if (uni.getStorageSync('visitor_code')) {
						uni.redirectTo({
							url: '../newBookpark/newBookpark?param=' + uni.getStorageSync('visitor_parkcode')
						});
					} else {
						uni.switchTab({
							url: uni.getStorageSync('lastPagePath') ? uni.getStorageSync('lastPagePath') :
								'../home/index'
						});
					}
				} else {
					uni.setStorage({
						key: 'status',
						data: true
					}); //状态

					uni.setStorage({
						key: 'plateNos',
						data: ''
					}); //用户车牌号
					// v2.5.4新加的访客链接进入时的逻辑

					if (uni.getStorageSync('visitor_code')) {
						uni.redirectTo({
							url: '../addLicense/addLicense'
						});
					} else {
						uni.switchTab({
							url: uni.getStorageSync('lastPagePath') ? uni.getStorageSync('lastPagePath') :
								'../home/index'
						});
					}
				}
			},			
			change1() {},

			change2({
				detail
			}) {
				const value = this.topoption2.find((e) => e.value === detail).value;

				if (value == 1) {
					//关注
					this.getParklistLike();
				} else {
					//全部
					this.getParklist(1);
				}
			},
			goMy() {
				uni.navigateBack({
					delta: 1
				});
			},
			change3() {},

			changeDrop(e) {
				this.setData({
					value1: e.detail,
					showDropdown: false
				});
				this.getParklist(); // this.getParklistLike()
			},

			likeThisPark(event) {
				//关注车场
				let that = this;

				if (event.currentTarget.dataset.id) {
					let type = event.currentTarget.dataset.isfocus == 1 ? 2 : 1; //1关注，2取消关注

					util.request(api.addOrUpdateFocus + '?unionId=' + uni.getStorageSync('unionId') + '&parkingCode=' +
							event.currentTarget.dataset.id + '&type=' + type, 'get')
						.then((res) => {
							if (res.success) {
								if (event.currentTarget.dataset.isfocus == 1) {
									//取消关注成功
									event.currentTarget.dataset.item.isFocus = 0;
									var _popData = that.popData;
									_popData[event.currentTarget.dataset.index] = event.currentTarget.dataset.item;
									that.setData({
										popData: _popData
									});
									uni.showToast({
										title: '取消关注成功'
									});
									this.getParklist();
									this.getMaplist();
								} else if (event.currentTarget.dataset.isfocus == 0) {
									//添加关注成功
									event.currentTarget.dataset.item.isFocus = 1;
									var _popData = that.popData;
									_popData[event.currentTarget.dataset.index] = event.currentTarget.dataset.item;
									that.setData({
										popData: _popData
									});
									uni.showToast({
										title: '关注成功'
									});
									this.$forceUpdate()
									uni.requestSubscribeMessage({
										tmplIds: ['G-qqlo3c5ARPqg9lPCnCrSUxAEgZ8bPfrEpd0UVE-8o'],

										success(sus) {},

										fail(err) {}
									});
									this.getParklist();
									this.getMaplist();
								}
							}
						})
						.catch((err) => {
							console.log(err);
						});
				}
			},

			//获取关注停车场列表数据
			getParklistLike() {
				if (!uni.getStorageSync('unionId') || !this.latitude) {
					return;
				}

				let param = {
					unionId: uni.getStorageSync('unionId'),
					mapy: this.latitude,
					mapx: this.longitude,
					contentSearch: this.isSearch,
					type: this.value1,
					pageNumber: 1,
					pageSize: 40
				};
				util.request(api.myFocus, param, 'POST', 'application/x-www-form-urlencoded')
					.then((res) => {
						uni.hideLoading({
							success: (res) => {}
						});
						this.setData({
							isShowLoading: false
						});

						if (res.success) {
							let list = res.data.content;

							if (list) {
								list.map((item) => {
									if (item.productVOs) {
										item.productVOs.map((i) => {
											if (i.type == 3) {
												item.tempReserveProduct = i;
											} else if (i.type == 4) {
												item.tempProduct = i;
											}
										});
									}
								});
							} // list = list.filter(function (item) {
							//   return item.distance < 1000
							// })
							// console.log(list)
							this.setData({
								parkList: list ? list : []
							});
						} else {
							uni.showToast({
								title:res.msg || '接口出错了，请稍后再试',
								icon:'none'
							})
						}
					})
					.catch((err) => {
						uni.showToast({
							title: err || '接口出错了，请稍后再试',
							icon: 'none'
						});
					});
			},

			//获取停车场列表数据
			getParklist(needAll) {
				//needAll 表示是否需要全部列表
				var needAll = needAll ? needAll : 0;
				let param = {
					mapy: this.latitude,
					mapx: this.longitude,
					contentSearch: this.isSearch,
					type: this.value1,
					pageNumber: 1,
					pageSize: 99999 // allowOrder:1
				};

				if (uni.getStorageSync('unionId')) {
					param.unionId = uni.getStorageSync('unionId');
				}

				util.request(api.getParklist, param, 'POST', 'application/x-www-form-urlencoded')
					.then((res) => {
						uni.hideLoading({
							success: (res) => {}
						});
						this.setData({
							isShowLoading: false
						});

						if (res.success) {
							let list = res.data.content;

							if (list) {
								list.map((item) => {
									if (item.productVOs) {
										item.productVOs.map((i) => {
											if (i.type == 3) {
												item.tempReserveProduct = i;
											} else if (i.type == 4) {
												item.tempProduct = i;
											}
										});
									}
								});
							}

							if (!needAll) {
								list = list.filter(function(item) {
									return item.distance < 1500; //1000
								});
							}
							console.log(list)
							this.setData({
								parkList: list // parkListLike: list[0]?[list[0]]:[]
							});

							if (this.markers.length <= 1) {
								this.getMaplist();
							}
						} else {
							uni.showToast({
								title:res.msg || '接口出错了，请稍后再试',
								icon:'none'
							})
						}
					})
					.catch((err) => {
						uni.showToast({
							title: err || '接口出错了，请稍后再试',
							icon: 'none'
						});
					});
			},

			//获取地图撒点数据
			getMaplist() {
				let param = {
					mapy: this.latitude,
					mapx: this.longitude ,// allowOrder:1
				};

				if (uni.getStorageSync('unionId')) {
					param.unionId = uni.getStorageSync('unionId');
				}

				util.request(api.getMaplist, param, 'POST', 'application/x-www-form-urlencoded')
					.then((res) => {
						let markerList = res.data;
						var _markerList = [];

						for (var i = 0; i < markerList.length; i++) {
							for (var j = 0; j < markerList[i].mapAnalysisDBVOs.length; j++) {
								_markerList.push(Object.assign({}, markerList[i], markerList[i].mapAnalysisDBVOs[j]));
							}
						}

						markerList = _markerList;
						for (var key in markerList) {
							var marker = markerList[key];
							marker.id = Number(key);
							marker.latitude = Number(marker.gmapY);
							marker.longitude = Number(marker.gmapX);
							marker.width = 52;
							marker.height = 62;
							marker.label = {
								content: String(marker.realFreeNum) || '0',
								fontSize: 12,
								anchorX: -(0.5 * (marker.realFreeNum.toString().length * 8)) - 8,
								anchorY: -48,
								bgColor: '#fff',
								borderRadius: 100,
								padding: 8,
								textAlign: 'center',
							};
							// marker.customCallout= {
							// 	anchorY: 70,
							// 	anchorX: 0,
							// 	display: 'ALWAYS',
							// }
							if(marker.realFreeNum>99){
								marker.label.padding=5
								marker.label.anchorX=-(0.5 * (marker.realFreeNum.toString().length * 8)) - 5
								marker.label.anchorY=-46
							}
							if(marker.realFreeNum>999){
								marker.label.anchorY = -52;
								marker.label.padding = 7
								marker.width = 60;
								marker.height = 70;
							}
							if (marker.notOpenToALLParkingNum > 0 && marker.openToALLParkingNum == 0) {} else if (
								marker.notOpenToALLParkingNum > 0) {}
							if ( marker.openProperty == 2 && marker.parkingAttribute == 1 && marker.isAuth != 1) {
								marker.label.color = '#A8A8A8';
								marker.iconPath = '../../static/assets/img/pointGray.png';
							} else if( marker.parkingAttribute == 4 ) {
								marker.label.color = '#167CEF';
								marker.iconPath = '../../static/assets/img/pointBlue.png';
							} else {
								marker.label.color = '#00BCAB';
								marker.iconPath = '../../static/assets/img/pointGreen.png';
							}
							let list = marker.mapAnalysisDBVOs;
							if (list) {
								list.map((item) => {
									if (item.productVOs) {
										item.productVOs.map((i) => {
											if (i.type == 3) {
												item.tempReserveProduct = i;
											} else if (i.type == 4) {
												item.tempProduct = i;
											}
										});
									}
								});
							}

							list = list.filter(function(item) {
								return item.distance < 1500;
							});
						}
							let arr =[
								{
									id:-1,
									longitude:this.longitude,
									latitude:this.latitude,
									name:''
								}
							]
							let markers_01 = []
							for (var i=0;i<arr.length;i++){
								markers_01=markers_01.concat({
									id:arr[i].id,
									latitude: arr[i].latitude,//纬度
									longitude: arr[i].longitude,//经度
									width: 25,
									height: 41,
									iconPath:'../../static/assets/img/marker.png',
								})
							}
							
						markerList.push(markers_01)				
						this.setData({
							markers: markerList,
							isSearching: uni.getStorageSync('isSearching')
						});
						markerList.forEach((it,index)=>{
							if(it.guidePicture){
							}
						})
						if (uni.getStorageSync('searchHistory')) {
							this.selectAddr(uni.getStorageSync('searchHistory')[0]);
							uni.removeStorageSync('searchHistory');
						}
					})
					.catch((err) => {
						uni.showToast({
							title: err || '接口出错了，请稍后再试',
							icon: 'none'
						});
					});
			},

			/**
			 * 每隔30秒地图刷新方法
			 */
			refreshMap() {
				let that = this;
				var i = setInterval(() => {
					that.getMaplist();
				}, 30000);
				this.setData({
					timer: i
				});
			},

			// 事件处理函数
			bindViewTap() {
				uni.navigateTo({
					url: '../logs/logs'
				});
			},

			// 车位引导图
			toNavigateYd(e) {
				uni.navigateTo({
					url: '../parkImgNav/index?parkingCode=' +
						e.currentTarget.dataset.id +
						'&guidePicture=' +
						e.currentTarget.dataset.guidepicture +
						'&name=' +
						e.currentTarget.dataset.name
				});
			},

			/**
			 * 获取用户当前位置,获取后调用接口数据
			 *
			 */
			getCurLocation() {
				let that = this;
				uni.getLocation({
					type: 'gcj02',
					success: (res) => {
						this.setData({
							latitude: res.latitude,
							//res.latitude 30.175580
							longitude: res.longitude //res.longitude 120.141186
						});
						this.setData({
							center: [this.longitude, this.latitude]
						});
						this.getParklist(); // this.getParklistLike();

						this.getMaplist();
					},

					fail(e) {
						uni.getSetting({
							success(result) {
								// 先获取用户是否已开启定位权限
								let setting = result.authSetting;
								let setLocation = 'scope.userLocation';

								if (!setting[setLocation]) {
									// 定位权限未开启，引导设置
									uni.showModal({
										title: '温馨提示',
										content: '您已拒绝定位,请开启',
										confirmText: '去设置',

										success(res) {
											if (res.confirm) {
												//打开授权设置
												that.openSetting();
											}
										}
									});
								}
							}
						});
					}
				});
			},

			/**
			 * 点击地图上定位按钮回到起始位置
			 */
			moveTolocation: function() {
				var mapCtx = uni.createMapContext('mymap'); //wxml中map标签的id值

				mapCtx.moveToLocation();
				this.getCurLocation();
				this.setData({
					isSearching: false,
					isSearch: 0
				});
			},

			/**
			 * 点击跳转发布车位
			 */
			releasePark() {
				if (uni.getStorageSync('AUTHORIZATION')) {
					util.request(api.myUnitList + '?unionId=' + uni.getStorageSync('unionId'), 'get').then((res) => {
						if (res.code == 0) {
							if (res.data.length > 0) {
								uni.navigateTo({
									url: '../setParking1/index'
								});
							} else {
								// wx.navigateTo({
								//   url: "../community1/index"
								// });
								uni.switchTab({
									url: '../community1/index'
								});
							}
						} else {
							uni.showToast({
								title:res.msg || '接口出错了，请稍后再试',
								icon:'none'
							})
						}
					});
				} else {
					uni.navigateTo({
						url: '../login/index'
					});
				}
			},

			closeReleasePark() {
				this.setData({
					hideReleasepop: true
				});

				if (uni.getStorageSync('AUTHORIZATION')) {
					this.setData({
						isLogin: 1
					});
					this.getParklistLike();
				}
			},

			/**
			 * 点击标记点
			 */
			markerTap(e) {
				let markerId;
				var that = this;
				var parkingCode = e.currentTarget.dataset.parkingcode;
				var openproperty = e.currentTarget.dataset.openproperty;
				var isauth = e.currentTarget.dataset.isauth;
				var parkingattribute = e.currentTarget.dataset.parkingattribute;
				if(parkingattribute == 1 && openproperty == 2 && isauth != 1){
					uni.showToast({
						title:'该小区仅对居民内部开放',
						icon:'none'
					})
				}else{
					if (parkingCode != undefined) {
						//根据unitCode筛选出markers里面的点位
						let curMarker = this.markers.filter(function(item) {
							// 使用filter方法
							if (item.parkingCode == parkingCode) {
								return item;
							}
						});
						curMarker = curMarker[0];
					
						if (curMarker && curMarker.code) {
							for (var i = 0; i < this.markers.length; i++) {
								if (this.markers[i].code &&this.markers[i].realFreeNum<1000) {
									this.markers[i].height = 62;
									this.markers[i].width = 52;
								}
					
								
								if (this.markers[i].label &&this.markers[i].realFreeNum<1000) {
									this.markers[i].label.anchorY = -48;
									this.markers[i].label.anchorX= -(0.5 * (this.markers[i].realFreeNum.toString().length * 8)) - 8
									this.markers[i].label.padding = 8
									if(this.markers[i].realFreeNum>99){
										this.markers[i].label.padding=5
										this.markers[i].label.anchorX=-(0.5 * (this.markers[i].realFreeNum.toString().length * 8)) - 5
										this.markers[i].label.anchorY=-46
									}
								}
							}
					
							curMarker.label.anchorY = -49;
							// curMarker.height = 70;
							// curMarker.width = 60;
						}
					
						this.setData({
							markers: that.markers,
							center: [curMarker.gmapX, curMarker.gmapY]
						});
						this.setData({
							showPop: true,
							popData: [curMarker]
						});
					} else {
						markerId = e.detail.markerId;
						let curMarker = this.markers[markerId];
					
						if (curMarker.authNumber == 0 && curMarker.openToALLParkingNum == 0) {
							uni.showToast({
								title:'抱歉，共享车位仅限本小区居民预约',
								icon:'none'
							})
						} else {
							if (curMarker && curMarker.code) {
								for (var i = 0; i < this.markers.length; i++) {
									if (this.markers[i].code &&this.markers[i].realFreeNum<1000) {
										this.markers[i].height = 62;
										this.markers[i].width = 52;
									}
					
									if (this.markers[i].label &&this.markers[i].realFreeNum<1000) {
										this.markers[i].label.anchorY = -48;
										this.markers[i].label.anchorX= -(0.5 * (this.markers[i].realFreeNum.toString().length * 8)) - 8
										this.markers[i].label.padding = 8
										if(this.markers[i].realFreeNum>99){
											this.markers[i].label.padding=5
											this.markers[i].label.anchorX=-(0.5 * (this.markers[i].realFreeNum.toString().length * 8)) - 5
											this.markers[i].label.anchorY=-46
										}
										
									}
								}
								
								curMarker.label.anchorY = -55;
								curMarker.height = 70;
								curMarker.width = 60;
								curMarker.label.padding = 10
								if(curMarker.realFreeNum>99){
									curMarker.label.anchorY = -52;
									curMarker.label.padding = 7
								}
							}
					
							this.setData({
								markers: that.markers,
								showPop: true,
								popData: [this.markers[markerId]]
							});
						}
					}
					
				}
				
			},

			/**关闭底部弹窗 */
			closePop() {
				this.setData({
					allParkFlag: false,
					showPop: false
				});

				if (uni.getStorageSync('AUTHORIZATION')) {
					this.setData({
						isLogin: 1
					});
					this.getParklist();
				}
			},

			//到这去
			gotoHere(e) {
				this.setLog('GO_HERE');
				const data = e.currentTarget.dataset.data;
				let param = {
					latitude: Number(data.gmapY),
					longitude: Number(data.gmapX),
					address: data.address
				};
				this.onRunApi(param);
			},

			goAllParking() {
				if (this.isSearching) {
					uni.navigateTo({
						url: '../index2/index?isSearching=' + this.isSearching
					});
				} else {
					uni.navigateTo({
						url: '../index2/index'
					});
				}
			},

			/**唤起导航 */
			toNavigate(e) {
				this.setLog('NAVIGATION');
				const data = e.currentTarget.dataset.data;
				let param = {
					latitude: Number(data.gmapY),
					longitude: Number(data.gmapX),
					address: data.address
				};
				this.onRunApi(param);
			},

			//点击整个卡片 需判断是否支持临停，或包月 或都支持
			buyParking(e) {
				this.setLog('PARKING_SPACE_LIST');
				const data = e.currentTarget.dataset.data;

				if (data.supportBusiness.indexOf('0') > -1 || data.supportBusiness == '') {
					uni.showToast({
						title:'抱歉，该车场未开通停车业务',
						icon:'none'
					})
				} else if (data.supportBusiness.indexOf('1') > -1) {
					this.tempParking(e);
				} else {
					this.monthlyParking(e);
				}
			},

			/**临停预约 */
			tempParking(e) {
				this.setLog('MONTHLY_SUBSCRIPTION_AND_RESERVATION');
				const data = e.currentTarget.dataset.data; // console.log(data);

				const isLogin = this.getIsLogin();
				if (isLogin) {
					if (data.parkingAttribute == 1  && data.openProperty == 2 && data.isAuth != 1) {
						uni.showToast({
							title:'抱歉，共享车位仅限本小区居民预约',
							icon:'none'
						})
						return
					} else if (data.supportBusiness.indexOf('1') < 0) {
						uni.showToast({
							title:'抱歉，该车场不支持临停预约业务',
							icon:'none'
						})
						return
					} else if (uni.getStorageSync('plateNos') == '') {
						this.setData({
							isShowAddLicense: true
						});
						return
					} else {
						let param = {
							parkingCode: data.parkingCode
						}; // const param = encodeURIComponent(JSON.stringify(data));
						// wx.navigateTo({
						//   url: "../parkDetail/parkDetail?type=0&param=" + param
						// });

						if (data.parkingAttribute == 1) {
							//小区自主定
							uni.navigateTo({
								url: '../newParklist/newParklist?parkingcode=' + data.parkingCode + '&active=0'
							});
						} else {
							uni.navigateTo({
								url: '../newBookpark/newBookpark?param=' + data.parkingCode +
									'&lltParkingInfoType=' + data.lltParkingInfoType //
							});
						}
					}
				} else {
					Toast('您未登录，请先登录');
					setTimeout(() => {
						uni.navigateTo({
							url: '../login/index'
						});
					}, 2000);
				}
			},

			/**包月 */
			monthlyParking(e) {
				this.setLog('MONTHLY_SUBSCRIPTION');
				const data = e.currentTarget.dataset.data;
				const type = e.currentTarget.dataset.type
				const isLogin = this.getIsLogin();

				if (isLogin) {
					if (data.parkingAttribute == 1 && data.openProperty == 2 && data.isAuth != 1) {
						uni.showToast({
							title:'抱歉，共享车位仅限本小区居民预约',
							icon:'none'
						})
						return
						// Toast('抱歉，共享车位仅限本小区居民预约');
					} else if (data.supportBusiness.indexOf('2') < 0 && data.supportBusiness.indexOf('3') < 0) {
						uni.showToast({
							title:'抱歉，该车场不支持包月业务',
							icon:'none'
						})
						return
						// Toast('抱歉，该车场不支持包月业务');
					} else if (uni.getStorageSync('plateNos') == '') {
						this.setData({
							isShowAddLicense: true
						});
						return
					} else {
						if (data.lltParkingInfoType == 2) {
							if (data.parkingAttribute == 1) {
								//小区自主定价
	
								uni.navigateTo({
									url: '../newParklist/newParklist?parkingcode=' + data.parkingCode + '&active=1'
								});
							} else {
								uni.navigateTo({
									url:
									    '../newMonthpark/newMonthpark?param=' +
									    data.parkingCode +
									    '&isAlipay=' +
									    data.isAlipay +
									    '&isWechat=' +
									    data.isWechat +
									    '&lltParkingInfoType=' +
									    data.lltParkingInfoType +
									    '&focus=' +
									    data.focus +
									    '&type=' +
									    type +
									    '&spaceNoId=' +
									    data.id //+data.lltParkingInfoType
										
								})
								// uni.navigateTo({
								// 	url: '../index2/index?searchName=' + data.parkingName
								// });
								return;
							}
						}
						let param = {
							parkingCode: data.parkingCode
						};

						if (data.parkingAttribute == 1) {
							//小区自主定价
							uni.navigateTo({
								url: '../newParklist/newParklist?parkingcode=' + data.parkingCode + '&active=1'
							});
						} else {
							uni.navigateTo({
								url:
								    '../newMonthpark/newMonthpark?param=' +
								    data.parkingCode +
								    '&isAlipay=' +
								    data.isAlipay +
								    '&isWechat=' +
								    data.isWechat +
								    '&lltParkingInfoType=' +
								    data.lltParkingInfoType +
								    '&focus=' +
								    data.focus +
								    '&type=' +
								    type +
								    '&spaceNoId=' +
								    data.id + //+data.lltParkingInfoType
									'&realFreeNum='+
									data.realFreeNum
							})
							// uni.navigateTo({
							// 	url: '../index2/index?searchName=' + data.parkingName
							// });
						}
					}
				} else {
					Toast('您未登录，请先登录');
					setTimeout(() => {
						uni.navigateTo({
							url: '../login/index'
						});
					}, 2000);
				}
			},

			/**
			 * 判断停车场里是否有车位,有则是否是固定的
			 */
			isHasParkinglot(e) {
				let param = {
					parkingCode: e
				};
				util.request(api.isHasParklot, param, 'POST', 'application/x-www-form-urlencoded').then((res) => {
					if (res.success) {
						this.setData({
							isFixSpaceNumer: res.data
						});
					} else {
						Toast(res.msg || '接口出错了，请稍后再试');
					}
				});
			},

			gotoPersonInfo() {
				// 判断是否登录，已登录进入个人中心；未登录进入注册登录页面
				if (uni.getStorageSync('AUTHORIZATION')) {
					this.setData({
						showUser: true
					});
				} else {
					uni.navigateTo({
						url: '../login/index'
					});
				}
			},

			onCloseUser() {
				this.setData({
					showUser: false
				});
			},

			getIsLogin() {
				if (uni.getStorageSync('AUTHORIZATION')) {
					return true;
				} else {
					return false;
				}
			},

			// 监听页面滚动事件
			handletouchmove(event) {
				let currentY = event.changedTouches[0].clientY;

				if (currentY <= this.startY) {
					this.setData({
						// btmTop: currentY > 200 ? currentY : 200,
						btmTop: 200,
						isScroll: true
					}); // console.log("上滑");
				} else {
					this.setData({
						showSearch: false,
						btmTop: 890,
						isScroll: false,
						showBack: false
					}); // console.log("下滑");
				}
			},

			//滑动开始事件
			handletouchstart: function(event) {
				this.setData({
					startY: event.changedTouches[0].clientY
				}); // this.data.startY = event.changedTouches[0].clientY;
				// console.log(this.data.startY);
			},

			//触摸结束
			handlerouchend(event) {
				let currentY = event.changedTouches[0].clientY; // console.log('初始是'+this.data.startY)
				// console.log('现在是'+currentY)

				if (currentY < this.startY) {
					this.setData({
						btmTop: 200,
						isScroll: true
					});
				}
			},

			//回到开始位置
			tapDown() {
				this.setData({
					showSearch: false,
					btmTop: 890,
					isScroll: false,
					showBack: false
				});
			},

			/**
			 * 搜索框失去焦点-若搜索内容为空，则默认返回
			 */
			inputBlur() {
				if (this.autoSearch == '') {
					this.clearInput();
					this.tapDown();
				}
			},

			/**
			 * 搜索框聚焦
			 */
			focusInput() {
				// let that = this;
				// this.setData({
				//   btmTop: this.data.btmTop==200?200:500,
				//   showSearch:true,
				//   isScroll: true,
				//   showBack:true,
				// });
				uni.navigateTo({
					url: '../searchParkspace/searchParkspace'
				});
			},

			/**
			 * 搜索框点击返回
			 */
			goBack() {
				this.clearInput();
				this.tapDown();
			},

			//清除搜索框输入内容
			clearInput() {
				this.setData({
					autoSearch: '',
					isSearch: 0,
					showSearch: false,
					isSearching: false,
					showBack: false,
					center: [this.longitude, this.latitude],
					addressList: []
				});
				this.getCurLocation();
			},

			//搜索框输入中事件
			getAddress(e) {
				this.setData({
					autoSearch: e.detail
				});

				if (e.detail.length > 0) {
					this.setData({
						isSearching: true
					});
				} else {
					this.setData({
						isSearching: false
					});
				}

				this.getPoi();
			},

			/**
			 * 搜索地址的方法--必须在以下地址里为对应的小程序购买服务，并将订单数据下的appid放到下面的“service"中
			 * https://fuwu.weixin.qq.com/service/detail/00002c301c0ac83ddc996d8ca56015
			 */
			getPoi() {
				const data = {
					keyword: this.autoSearch,
					boundary: 'region(杭州)'
				};
				uni.serviceMarket
					.invokeService({
						service: 'wxc1c68623b7bdea7b',
						api: 'poiSearch',
						data: data
					})
					.then((res) => {
						const result = typeof res.data === 'string' ? JSON.parse(res.data) : res.data;
						this.setData({
							addressList: result.data
						});
					})
					.catch((err) => {
						console.error(err);
					});
			},

			/**选择搜索的列表里的地址 */
			selectAddr(e) {
				try {
					if (this.markers[this.markers.length - 1].id == 'poiMarker') {
						this.markers.splice(this.markers.length - 1, 1);
					}
				} catch (error) {} // let data = e.currentTarget.dataset.data

				let data = e;
				let lng = data.location ? data.location.split(',')[0] : '';
				let lat = data.location ? data.location.split(',')[1] : '';
				this.setData({
					// autoSearch:data.title,
					// longitude: data.location.lng,
					// latitude: data.location.lat,
					longitude: lng,
					latitude: lat,
					isSearch: 1,
					// showSearch:false,
					center: [lng, lat],
					markers: this.markers.concat({
						latitude: lat,
						longitude: lng,
						iconPath: '/static/pages/index/imgs/marker.png',
						width: 25,
						height: 41,
						id: 'poiMarker'
					})
				});
				uni.showLoading({
					title: '加载中'
				});
				this.setData({
					isShowLoading: true
				});
				this.getParklist(); // this.getParklistLike()

				this.tapDown();
				this.setData({
					isSearching: uni.getStorageSync('isSearching')
				});
				uni.removeStorageSync('isSearching'); //查询完就移除掉
			},

			/**
			 * 搜索列表的导航
			 */
			gotoNavigate(e) {
				// console.log(e);
				const data = e.currentTarget.dataset.data;
				let param = {
					latitude: Number(data.location.lat),
					longitude: Number(data.location.lng),
					address: data.address
				};
				this.onRunApi(param);
			},

			/**调用导航 */

			/**需要引入util判断版本
     * @param {e} e 参数e是一个对象
     * address:目标地址，必填
     * latitude:目标地址纬度,必须是number类型
     * longitude：目标地址经度，必须是number类型
     * 必须在wxml页面创建一个地图，若是不展示地图则将地图设置hidden=true,可将下列代码直接复制
     * <view hidden="true">
      <map
          class="map"
          id="mymap"
      >
        </map>
      </view>
     */
			onRunApi(e) {
				const version = uni.getSystemInfoSync().SDKVersion;
				if (uni.getStorageSync('weixin') == 2) {
					jWeixin.miniProgram.navigateTo({
						url: "/pages/map/map?lat=" + e.latitude + '&long=' + e.longitude
					})
				} else {
					// window.location.href = 'http://api.map.baidu.com/marker?location=' + e.latitude + ',' + e.longitude +'&title='+ e.address +'&content=&output=html' //百度
					// window.location.href = 'http://apis.map.qq.com/uri/v1/marker?marker=coord:' + e.latitude + ',' + e.longitude +';addr:'+ e.address   //腾讯导航
					window.location.href = 'http://uri.amap.com/marker?position=' + e.latitude + ',' + e.longitude +
						'&name=' + e.address + '&coordinate=gaode&callnative=1' //高德
				}
				// window.location.href = 'http://api.map.baidu.com/marker?location=' + e.latitude + ',' + e.longitude +'&title='+ e.address +'&content=&output=html' //百度
				// window.location.href = 'http://apis.map.qq.com/uri/v1/marker?marker=coord:' + e.latitude + ',' + e.longitude +';addr:'+ e.address   //腾讯导航
				// window.location.href = 'http://uri.amap.com/marker?position=' + e.latitude + ',' + e.longitude +'&name='+ e.address +'&coordinate=gaode&callnative=1'  //高德

				// if (util.compareVersion(version, '2.14.0') < 0) {
				//     uni.showToast({
				//         title: '当前微信版本过低，无法使用该功能，请升级到最新微信版本后重试。',
				//         icon: 'none'
				//     });
				//     return;
				// }

				// const mapCtx = uni.createMapContext('mymap');
				// mapCtx.openMapApp({
				//     latitude: e.latitude,
				//     longitude: e.longitude,
				//     destination: e.address,
				//     complete: (res) => {
				//         console.log(res);
				//     }
				// });
			},

			imageLoad: function() {
				var that = this;
				uni.getSystemInfo({
					success: function(res) {
						//我们设计图片的尺寸是750*388
						var width = res.windowWidth; //获取当前屏幕的宽度

						var rao = 750 / width; //图片宽度／屏幕的宽度

						var height = 288 / rao; //图片高度／比例

						that.setData({
							imgheights: height //设置等比缩放的宽度
						});
					}
				});
			},

			openSetting() {
				uni.openSetting();
			},

			/**
			 * 页面埋点
			 */
			setLog(e) {
				let param = {
					operation: e
				};
				util.request(api.setLog, param, 'POST', 'application/x-www-form-urlencoded')
					.then((res) => {
						if (res.success) {
				
						}
					})
					.catch((err) => {
						console.log(err);
					});
			},

			/*是否有未支付订单 */
			isWaitingtopay() {
				let param = {
					unionId: uni.getStorageSync('unionId')
				};
				util.request(api.isWaitingtopay, param, 'POST', 'application/x-www-form-urlencoded')
					.then((res) => {
						if (res.success) {
							this.setData({
								isShowPayTip: res.data == -1 ? false : true,
								gotopayType: res.data
							});
						}
					})
					.catch((err) => {
						console.log(err);
					});
			},

			/**跳转支付 */
			gotoPay(e, _dataset) {
				/* ---处理dataset begin--- */
				// this.datasetHandle(e, _dataset);
				/* ---处理dataset end--- */
				this.setData({
					isShowPayTip:false
				})
				uni.navigateTo({
					url: '../order/index?type=' + this.gotopayType
				});
			},

			/**
			 * 打开下拉框选择
			 */
			showDropDown() {
				this.$mp.page.selectComponent('#dropdown').toggle();
				this.setData({
					showDropdown: true
				});
			},

			//关闭下拉选择
			closedrop() {
				this.setData({
					showDropdown: false
				});
			},

			noResponse() {
			
			},

			// 使用高德提供的天气
			getWeather() {
				let that = this;
				var myAmapFun = new amapFile.AMapWX({
					key: 'a29210026b1d7fd7df6f765b2588c301'
				});
				myAmapFun.getWeather({
					success: function(data) {
						// console.log(data)
						that.setData({
							weather: data.liveData
						}); //成功回调
					},
					fail: function(info) {
						//失败回调
						console.log(info);
					}
				});
			},

			// 获取限牌
			getTrafficControl() {
				util.request(api.getTrafficControl, '', 'GET')
					.then((res) => {
						if (res.success) {
							this.setData({
								controlNo: res.data == null ? '' : res.data.join(' ')
							});
						}
					})
					.catch((err) => {
						console.log(err);
					});
			},

			/**  点击跳转添加车牌 */
			gotoAddLicense(e, _dataset) {
				/* ---处理dataset begin--- */
				// this.datasetHandle(e, _dataset);
				/* ---处理dataset end--- */
				uni.navigateTo({
					url: '../addLicense/addLicense'
				});
			},

			// 加入我们
			gotoJoin() {
				uni.navigateTo({
					url: '../joinUS/joinUS'
				});
			},

			refreshSearch() {
				// this.onShow();
				// this.setData({
				//   searchShow:false
				// })
				
				uni.removeStorageSync('searchHistory');
				uni.navigateBack()
			},
			//切换列表
			goList(){
				uni.navigateTo({
					url:'../index2/index'
				})
			}
		}
	};
</script>
<style>
	@import './index.css';
</style>
